const Router=require('koa-router');

let news=new Router();
news.get('/',async ctx=>{
    await ctx.render('news',{
        news:[
            {id:'1',title:'News-1',time:'2017-10-10 9:33:52'},
            {id:'2',title:'News-2',time:'2017-10-10 9:33:52'},
            {id:'3',title:'News-3',time:'2017-10-10 9:33:52'},
            {id:'4',title:'News-4',time:'2017-10-10 9:33:52'},
            {id:'5',title:'News-5',time:'2017-10-10 9:33:52'}
        ]
    });
});
news.get('/:id',async ctx=>{
    await ctx.render('newsInfo',{
        info:{
            id:ctx.params.id
        }
    });
});


module.exports=news;